﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Data;
using PolePositionMobileUtilityGeneral;

namespace PolePositionMobileUtilityEntity
{
    public class EClass : ELookup
    {
        public EClass()
            : base()
        {
            m_TableColumnType = "Classes";
        }
        public EClass(int id, string name)
            : this()
        {
            Id = id;
            Name = name;
        }

        public EClass[] GetAll()
        {
            DataTable _dt = SelectAll();
            EClass[] _classesArr = new EClass[_dt.Rows.Count];
            for (int i = 0; i < _dt.Rows.Count; i++)
            {
                _classesArr[i] = new EClass(ConvertMobileHelper.ToInt32(_dt.Rows[i][m_TableCollumnId]), ConvertMobileHelper.Tostring(_dt.Rows[i][m_TableCollumnName]));
            }
            return _classesArr;
        }
    }
}
